var myChart = echarts.init(document.getElementById("container2"));

option = {
    title: {
		// left:"center",
        text: '气体浓度对照图',
        textStyle:{
        	color:"#58FAF4"
        }
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    legend: {
		left:"right",
        data: ['昨天', '今天'],
		textStyle:{
			color:"rgb(128, 128, 128)"
		}
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: {
        type: 'value',
        boundaryGap: [0, 0.01]
    },
    yAxis: {
        type: 'category',
        data: ['氧气', '二氧化碳', '一氧化碳']
    },
    series: [
        {
            name: '昨天',
            type: 'bar',
            data: [182, 234, 290]
        },
        {
            name: '今天',
            type: 'bar',
            data: [325, 438, 200]
        }
    ]
};

// setInterval(function () {
//     option.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
//     myChart.setOption(option, true);
// }, 2000);

// if (option && typeof option === 'object') {
    myChart.setOption(option);
// }